<template>
  <div v-if="message"
       style="color:#eb662b;">{{message}}</div>
  <div v-else>无</div>
</template>
<script>
export default {
  name: "Warnings",
  props: {
    row: {
      type: Object,
      default: () => { }
    }
  },
  data () {
    return {};
  },
  computed: {
    message () {
      let warnArr = [];
      let goodsList = this.row?.goodsList || [];
      goodsList.length && goodsList?.forEach((item) => {
        if (item.warnings?.length) {
          warnArr.push(item.name)
        }
      });
      return warnArr.length ? `物品名称：${warnArr.toString()}在系统中有多条，请点击修改，进入详情页确认` : null;
    }
  }
};
</script>
